<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It is a breeze. Simply tell Lumen the URIs it should respond to
| and give it the Closure to call when that URI is requested.
|
*/
// 闭包方法
$app->get('/', function () use ($app) {
    return $app->version();
});

// 分组模式
//$app->group(['prefix' => 'api/v1'], function($app)
//{
//    $app->post('car','CarController@createCar');
//    $app->put('car/{id}','CarController@updateCar');
//    $app->delete('car/{id}','CarController@deleteCar');
//    $app->get('car','CarController@index');
//});

// 缓存测试
$app->group(['prefix' => 'cach/v1'], function($app)
{
    // Redis
    $app->get('redis','testController@redis');
    // Memcached
    $app->get('memcached','testController@memcached');
});

// 地图小工具
$app->group(['prefix' => 'map/v1'], function($app)
{
    // 地址转经纬度
    $app->get('latlng','MapController@getLatLngByAddres');
    // 经纬度转地址
    $app->get('addres','MapController@getAddressByLngLat');
    // 坐标系转换接口
    $app->get('coordinateSwitch','MapController@getCoordinate');
    // ip定位接口
    $app->get('getCityByIP','MapController@getCityByIP');
});

// 聚合数据API实用工具
$app->group(['prefix' => 'juhe/v1'], function($app)
{
    // 获取周边WiFi热点信息--根据经纬度
    $app->get('getNearbyWifiByLngLat','JuheController@getNearbyWifiByLngLat');
    // 获取周边WiFi热点信息--根据城市名
    $app->get('getNearbyWifiByCity','JuheController@getNearbyWifiByCity');
});










